<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%--
  Created by IntelliJ IDEA.
  User: 86177
  Date: 2021/11/22
  Time: 9:35
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <!--视口 自适应-->
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!--bootstrap样式 -->
    <link rel="stylesheet" href="resource/css/bootstrap.css">
    <script src="resource/js/jquery-3.2.1.js"></script>
    <!--bootstrap.js 必须放在jquery.js下面 -->
    <script src="resource/js/bootstrap.js"></script>
    <title>Title</title>
</head>
<form>
    订单编号:<input type="text" name="orderId" value="${vo.orderId}">
    下单时间:<input type="date" name="minDate" value='<fmt:formatDate value="${vo.minDate}" pattern="yyyy-MM-dd"></fmt:formatDate>'>
    至 <input type="date" name="maxDate" value='<fmt:formatDate value="${vo.maxDate}" pattern="yyyy-MM-dd"></fmt:formatDate>'>
    备注:<input type="text" name="text" value="${vo.text}"><br>
    <select name="colum">
        <option value="" >--请选择--</option>
        <option value="order_name" ${vo.colum == 'order_name' ? 'selected' :''}>制单人</option>
        <option value="order_ck" ${vo.colum == 'order_ck' ? 'selected' :''}>仓库</option>
        <option value="order_kw" ${vo.colum == 'order_kw' ? 'selected' :''}>库位</option>
        <option value="order_dh" ${vo.colum == 'order_dh' ? 'selected' :''}>订货人</option>
        <option value="order_odd" ${vo.colum == 'order_odd' ? 'selected' :''}>物流单号</option>
        <option value="order_address" ${vo.colum == 'order_address' ? 'selected' :''}>交货地点</option>
    </select>
    <input type="text" name="context" value="${vo.context}">
    <select name="col">
        <option value="">--请选择--</option>
        <option value="order_money" ${vo.col == 'order_money' ? 'selected' :''}>总金额</option>
        <option value="order_mon" ${vo.col == 'order_mon' ? 'selected' :''}>折让金额</option>
        <option value="order_image" ${vo.col == 'order_image' ? 'selected' :''}>附件成本</option>
    </select>
    <input type="text" name="minText" value="${vo.minText}"> 至 <input type="text" name="maxText" value="${vo.maxText}">
    排序:<a href="">下单时间</a>&nbsp;<a href="">总金额</a>
    <input type="button" value="查询" onclick="goPage(1)">
</form>
<h3>当月累计总金额:${sum}元</h3>
<table class="table table-sm">
    <thead>
    <tr>
        <th scope="col">序号</th>
        <th scope="col">下单时间</th>
        <th scope="col">订单编号</th>
        <th scope="col">制单人</th>
        <th scope="col">仓库</th>
        <th scope="col">库位</th>
        <th scope="col">订货人</th>
        <th scope="col">总金额</th>
        <th scope="col">折让金额</th>
        <th scope="col">交货方式</th>
        <th scope="col">物流单号</th>
        <th scope="col">附件成本</th>
        <th scope="col">交货地点</th>
        <th scope="col">备注</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${pg.list}" var="l">
        <tr>
            <th scope="row">${l.id}</th>
            <td>
                <fmt:formatDate value="${l.orderDate}" pattern="yyyy-MM-dd"></fmt:formatDate>
            </td>
            <td>${l.orderId}</td>
            <td>${l.orderName}</td>
            <td>${l.orderCk}</td>
            <td>${l.orderKw}</td>
            <td>${l.orderDh}</td>
            <td>${l.orderMoney}</td>
            <td>${l.orderMon}</td>
            <td>${l.orderWay}</td>
            <td>${l.orderOdd}</td>
            <td>${l.orderImage}</td>
            <td>${l.orderAddress}</td>
            <td>${l.orderContext}</td>
        </tr>
    </c:forEach>
    </tbody>
</table>
<jsp:include page="${pageContext.request.contextPath}/resource/common/pages.jsp"></jsp:include>
<body>
</body>
<script>

    function goPage(PageNum){
        var url = "list?pageNum="+PageNum+"&"+$('form').serialize();
        $("#nav-tabContent").load(url);
    }
</script>
</html>
